package STUDENT.TRINHQUANGXUANDUC.OPPS.INHERISTANCE.BAI5;

public class Models extends Method {

	@Override
	public float cong(Pheptinh obj) {

		return (float) (obj.getA() + obj.getB());
	}

	@Override
	public float tru(Pheptinh obj) {
		return (float) (obj.getA() - obj.getB());
	}

	@Override
	public float nhan(Pheptinh obj) {
		return (float) (obj.getA() * obj.getB());
	}

	@Override
	public float chia(Pheptinh obj) {
		return (float) (obj.getA() / obj.getB());
	}

	@Override
	public void Cong(Pheptinh obj) {
		double kq = obj.getA() + obj.getB();
	}

	@Override
	public void Tru(Pheptinh obj) {
		double kq = obj.getA() - obj.getB();

	}

	@Override
	public void Nhan(Pheptinh obj) {
		double kq = obj.getA() * obj.getB();

	}

	@Override
	public void Chia(Pheptinh obj) {
		double kq = obj.getA() / obj.getB();
	}

	@Override
	public boolean checkPT(Pheptinh obj) {
		if (obj.getPheptinh() == 0) {
			return false;
		}
		return true;
	}

	@Override
	public boolean KTchiacho0(Pheptinh obj) {
		if (obj.getA() == 0 && obj.getB() != 0) {
			return false;
		}
		return true;
	}

	@Override
	public boolean ktchia0(Pheptinh obj) {
		if (obj.getA() == 0 && obj.getB() == 0) {
			return false;
		}
		return true;
	}

}
